package org.chl.chapter02;

import java.util.Map;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloService {
	
	@Resource(name = "nameMap")
	private Map<String, Object> nameMap;
	
	@GetMapping("hello")
	public String hello() {
		for (String key : nameMap.keySet()) {
			System.out.println(key + "=" + nameMap.get(key));
		}
		return (String) nameMap.get("chl");
	}
}
